Formalizing Simple Refinement Types in Coq An Experience Report
نویسندگان
چکیده
We consider refinement types in which base types can be refined by constraints expressible in some decidable logic. Such refinement types have been applied in many settings, such as certification of security policies [1, 10], and reasoning precisely about heap updates [9, 10]. A lot of work has been done on extensions of the basic idea of refinements, including inference in liquid types [8], or mixing static and dynamic checking with hybrid type checking [7]. Recently Chugh has proposed nested refinements [5], which allow the inclusion of type assertions in the logic of refinements. Combined with some heap reasoning, this allows static checking of complex idioms found in dynamic languages [4]. The meta-theory of these advanced forms of refinements can be tricky, and we believe it would be helpful to have a basic framework in Coq on top of which to explore more complex variants of refinement types (and their meta-theory). In this context, we hereby report on our effort to formalize in Coq a simple form of refinement types, and establish their soundness. We identify some key ideas and challenges involved in the formalization, including both the modeling of the language in Coq and the proof techniques we used.
منابع مشابه
Formalizing and Verifying Semantic Type Soundness of a Simple Compiler (Preliminary Report)
We describe a semantic type soundness result, formalized in the Coq proof assistant, for a compiler from a simple imperative language with heap-allocated data into an idealized assembly language. Types in the high-level language are interpreted as binary relations, built using both second-order quantification and a form of separation structure, over stores and code pointers in the low-level mac...
متن کاملFinitary-based Domain Theory in Coq: An Early Report
In his "Lectures on a Mathematical Theory of Computation" [5], Dana Scott formulated domains in terms of neighborhood systems. Later, Scott favored a formulation in terms of information systems [6] but has not rewritten his lectures notes. Cartwright and Parsons later revised Scott’s lecture notes to reflect a formulation of domains in terms of ‘finitary basis’ [3], where a finitary basis is an...
متن کاملPragmatic Quotient Types in Coq
In intensional type theory, it is not always possible to form the quotient of a type by an equivalence relation. However, quotients are extremely useful when formalizing mathematics, especially in algebra. We provide a Coq library with a pragmatic approach in two complementary components. First, we provide a framework to work with quotient types in an axiomatic manner. Second, we program constr...
متن کاملMechanized Verification of Computing Dominators for Formalizing Compilers
One prerequisite to the formal verification of modern compilers is to formalize computing dominators, which enable SSA forms, advanced optimizations, and analysis. This paper provides an abstract specification of dominance analysis that is sufficient for formalizing modern compilers; it describes a certified implementation and instance of the specification that is simple to design and reason ab...
متن کاملEmbedding the Refinement Calculus in Coq
The refinement calculus and type theory are both frameworks that support the specification and verification of programs. This paper presents an embedding of the refinement calculus in the interactive theorem prover Coq, clarifying the relation between the two. As a result, refinement calculations can be performed in Coq, enabling the interactive calculation of formally verified programs from th...
متن کامل